package com.lxy_s_springboot.lxy_s_springboot.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello")
public class HelloControler {
    @RequestMapping("/sayhi")
    public String sayhi() {
        return "Hello";
    }
    @RequestMapping(value = "/v1",method = RequestMethod.GET)
    public String print1(){
        return "hello print1";
    }
    //与@RequestMapping(value = "/v1",method = RequestMethod.GET)效果相同
    @GetMapping(value = "/v2")
    public String print2(){
        return "hello print2";
    }
    @RequestMapping(value = "/v3",method = RequestMethod.POST)
    public String print3(){
        return "hello print3";
    }
    //与@RequestMapping(value = "/v3",method = RequestMethod.POST)效果相同
    @PostMapping(value = "/v4")
    public String print4(){
        return "hello print4";
    }
}
